﻿using System;
using System.Collections.Generic;
using System.Text;
using CookComputing.XmlRpc;

namespace GraffitiExtras.Plugins.Pingomatic
{
    [XmlRpcUrl("http://rpc.pingomatic.com/RPC2")]
    public interface IPingomatic : IXmlRpcProxy
    {
        [XmlRpcMethod("weblogUpdates.ping")]
        UpdateResponse Ping(string name, string url);
    }

    public class WeblogsRPC
    {
        public static UpdateResponse Ping(string name, string url)
        {
            IPingomatic proxy = XmlRpcProxyGen.Create(typeof(IPingomatic)) as IPingomatic;
            return proxy.Ping(name, url);
        }
    }

    public struct UpdateResponse
    {
        public bool flerror;
        public string message;
    }
}
